package com.socialbank.web.controller;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import com.socialbank.web.bean.ResultMessage;
import com.socialbank.web.service.BankPersonalStoreService;
import com.wqdata.auth.util.UserUtils;

@Controller
@RequestMapping("/bank/PersonalStore")
public class BankPersonalStoreController {
	@Resource
	BankPersonalStoreService service;
	@RequestMapping("/save")
	@ResponseBody
	public Object save(MultipartFile file){
		String deptId=String.valueOf(UserUtils.getCurrrentDeptId());
		service.del(deptId);
		return service.save(file);
	}
	@RequestMapping("/getList")
	@ResponseBody
	public Object getList(){
		String deptId=String.valueOf(UserUtils.getCurrrentDeptId());
		Map<String, Object> result = new HashMap<>();
		result.put("data", service.getList(deptId));
		return new ResultMessage(200,"查询成功",result);
	}
}
